package com.zjp.mall.util;


import org.bouncycastle.util.encoders.Base64;

public class WechatDecrypt {


    public static String decode(String encryptedData,String session_key,String iv) throws Exception {

        byte[] decode = AESUtil.instance.decrypt( Base64.decode(encryptedData),Base64.decode(session_key),Base64.decode(iv));
        return new String(decode,"UTF-8");
    }

    public static boolean checkSignature(String signature,String sessionKey,String rowData){
        String signature2 = SHA1.encode(rowData + sessionKey);
        return signature.equals(signature2);
    }


}
